import {getRequest, postRequest} from "../baseRequest"

/**
 * 发布流程
 * @param data
 * @returns {AxiosPromise}
 */
export const convertBpmnRequest = (data) => postRequest(`/workflow/convertBpmn`, data)

/**
 * 流程设计
 * @param data
 * @returns {AxiosPromise}
 */
export const getBusinessDesignListRequest = (formKey) => getRequest(`/workflow/business/design/list/${formKey}`)
/**
 * 保存流程设计
 * @param data
 * @returns {AxiosPromise}
 */
export const saveBusinessDesignRequest = (data) => postRequest(`/workflow/business/design/save`, data)

/**
 * 发布流程设计
 * @param data
 * @returns {AxiosPromise}
 */
export const publishBusinessDesignRequest = (data) => postRequest(`/workflow/business/design/publish`, data)

/**
 * 获取流程设计
 * @param data
 * @returns {AxiosPromise}
 */
export const getBusinessFormRequest = (formKey) => getRequest(`/workflow/business/design/deployment//${formKey}`)
/**
 * 获取问卷流程实例
 * 包含数据 问卷项
 * @param data
 * @returns {AxiosPromise}
 */
export const getBusinessProcessFormRequest = (taskId, instanceId) => getRequest(`/workflow/business/process/form/`, {
  taskId: taskId,
  instanceId: instanceId
})

/**
 * 获取流程任务携带问卷属性
 * @param instanceId
 * @returns {number}
 */
export const getTaskPropertyRequest = (taskId) => getRequest(`/workflow/business/process/property/${taskId}`)


